<?php

namespace App\Http\Requests\Api;

class ResumeSkillRequest extends ApiRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'id' => $this->is('*/update') ? 'bail|required|integer' : '',
            'resume_id' => $this->is('*/create') ? 'bail|required|integer' : '',
            'skillname' => 'required',
            'degree' => 'bail|required|integer|between:1,3',
        ];
    }

    /*
     * 字段描述
     */
    public function attributes()
    {
        return [
            'skillname' => '技能名称',
            'degree' => '熟练程度',
        ];
    }
}